package ch.dreamweb.readpractice.client.lesetraining.train.event;

import com.google.gwt.event.shared.GwtEvent;

public class IncorrectEvent extends GwtEvent<IncorrectEventHandler> {

	public static Type<IncorrectEventHandler> TYPE = new Type<IncorrectEventHandler>();

	private final String wrong;
	private final int unit;

	public IncorrectEvent(String wrong, int unit) {
		this.wrong = wrong;
		this.unit = unit;
	}

	public int getUnit() {
		return unit;
	}

	@Override
	public Type<IncorrectEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(IncorrectEventHandler handler) {
		handler.onIncorrect(this);
	}

	public String getWrong() {
		return wrong;
	}
}
